package com.yuantu.judiciary.controller;

import com.yuantu.judiciary.common.Response;
import com.yuantu.judiciary.common.ResponseFactory;
import com.yuantu.judiciary.model.enums.ConfigType;
import com.yuantu.judiciary.service.ISysConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 系统配置管理模块
 *
 * @author syw
 * @since 2023-08-22
 **/
@RestController
@RequestMapping("/config")
@Api(tags = "系统配置管理模块")
@RequiredArgsConstructor
public class SysConfigController {

    private final ISysConfigService sysConfigService;

    @ApiOperation(value = "获取vip按钮是否开启")
    @GetMapping("/get/vip-button/state")
    public Response<Boolean> getVipButtonState() {
        return ResponseFactory.okResponse(sysConfigService.getConfigState(ConfigType.VIP_BUTTON));
    }

    @ApiOperation(value = "获取vip按钮是否开启(ios)")
    @GetMapping("/get/vip-button/state/ios")
    public Response<Boolean> getIosVipButtonState() {
        return ResponseFactory.okResponse(sysConfigService.getConfigState(ConfigType.VIP_BUTTON_IOS));
    }

    @ApiOperation(value = "获取企业尽调授权是否开启")
    @GetMapping("/get/enter-auth/state")
    public Response<Boolean> getEnterAuthState() {
        return ResponseFactory.okResponse(sysConfigService.getConfigState(ConfigType.AUTH_ENTER));
    }

}
